﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using HTMLHelpers.Models;

namespace HTMLHelpers.Controllers
{
    public class ValidationHelpersController : Controller
    {
        public ActionResult ValidationMessageSample()
        {
            return View();
        }

        public ActionResult ValidationSummarySample()
        {
            return View();
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult ValidationMessageSample(string booktitle, string summary)
        {
            ViewData.ModelState.AddModelError("booktitle", "Title cannot be empty");
            ViewData.ModelState.AddModelError("summary", "Summary cannot be empty");
            return View();
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult ValidationSummarySample(string booktitle, string summary)
        {
            // Add action logic here
            return ValidationMessageSample(booktitle, summary);
        }
    }
}
